Add Order Fulfillment Workflow and Workflow Saga demo apps#444
Add Order Fulfillment Workflow and Workflow Saga demo apps#444
Conversation
|
|
||
| <axon.version>5.1.0</axon.version> | ||
| <axoniq-framework.version>5.1.0</axoniq-framework.version> | ||
| <axon-workflow.version>1.0.0-SNAPSHOT</axon-workflow.version> |
There was a problem hiding this comment.
| <axon-workflow.version>1.0.0-SNAPSHOT</axon-workflow.version> | |
| <axon-workflow.version>0.1.0</axon-workflow.version> |
| - Java 21+ | ||
| - Maven 3.9+ | ||
| - Docker (for Axon Server) | ||
| - The Axon Workflow Engine (`io.axoniq.framework.workflow:*:1.0.0-SNAPSHOT`) installed in the local Maven repository |
There was a problem hiding this comment.
| - The Axon Workflow Engine (`io.axoniq.framework.workflow:*:1.0.0-SNAPSHOT`) installed in the local Maven repository | |
| - The Axoniq Workflow Engine (`io.axoniq.framework.workflow:*:1.0.0-SNAPSHOT`) installed in the local Maven repository |
| request payment + shipment in parallel, react to either of two payment outcomes, complete the | ||
| process — is expressed as plain imperative Java. | ||
|
|
||
| ## What got simpler |
There was a problem hiding this comment.
I'd word this section differently. It's fine to suggest things are better, but stating it like this is super on-the-nose and not in all cases entirely correct. It would come across as more honest if you also include what's better in a Saga compared to Workflows (from my pov, the massive single-method block is a massive no-no, for example).
smcvb
left a comment
There was a problem hiding this comment.
All seems fair to me, but I'd want @zambrovski to give his two cents as well before merging.
Furthermore, although it's great this is here, we have not yet updates the code-samples build with AF5 at all. So, it might be a bit early to have these modules already.
| @EventHandler | ||
| public void on(OrderPlaced event) { | ||
| var payload = new HashMap<String, Object>(); | ||
| payload.put("type", "PLACED"); |
There was a problem hiding this comment.
ObjectMapper can do it much faster by transforming a bean to Map<String, Object>.
zambrovski
left a comment
There was a problem hiding this comment.
I believe this has its own value to be presented here, independent of the visibility of examples we provide inside the module itself. This is a show case and it lives along side with other show cases.
Given the workflow-module is not public yet, I believe this one can be public before the access to the extension repository is changed to public.
So to me, if the proposed changes are applied, I see a value in publishing it here, in order to be able to show it to public already.
Co-authored-by: Steven van Beelen <steven.vanbeelen@axoniq.io>
Co-authored-by: Steven van Beelen <steven.vanbeelen@axoniq.io>
Summary
Two new demo modules showing how to model multi-step business processes with the Axon Workflow Engine:
order-fulfillment-workflow— order → reserve stock → payment → ship → notify. Includes a live tracking UI: Leaflet map with animated truck movement, status pills, stats panel and activity log, all driven by SSE pushed from the projection's@EventHandlers. One-click buttons trigger single orders, bursts, and failure scenarios (out-of-stock, payment-timeout).workflow-saga— saga-style order process showing wait/compensate patterns with the workflow DSL.Test plan
mvn verifyinorder-fulfillment-workflow/(Testcontainers IT spins up Axon Server)mvn verifyinworkflow-saga/mvn spring-boot:runinorder-fulfillment-workflow/, open http://localhost:9090/, click "Stress test ×25" and "Mixed burst" — markers should animate end-to-end on the map